package com.lawyer.repository;


import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import com.lawyer.entity.Coupon;


@RepositoryRestResource(exported = false)
public interface CouponRepository extends PagingAndSortingRepository<Coupon, Integer> , JpaSpecificationExecutor<Coupon> {
	
	List<Coupon> findByUserIdAndIsUsedAndIsExpire(String userId,Boolean isUsed,Boolean isExpire);
	
	List<Coupon> findByUserId(String userId);
	
	
	Coupon findByUserIdAndIsUsedAndId(String userId,Boolean isUsed,Integer id);
	
	@Override
	public List<Coupon> findAll();
	
}
